//
//  LLT_PlayerHeroViewCell_LXM.m
//  CoderLLT
//
//  Created by 刘晓萌 on 15/12/15.
//  Copyright © 2015年 刘晓萌. All rights reserved.
//

#import "LLT_PlayerHeroViewCell_LXM.h"
#import "UIImageView+WebCache.h"
#import "ProgressBarView.h"
@interface LLT_PlayerHeroViewCell_LXM ()

@property (weak, nonatomic) IBOutlet UIImageView *heroImage;
@property (weak, nonatomic) IBOutlet UILabel *per;
@property (weak, nonatomic) IBOutlet UILabel *useCount;
@property (weak, nonatomic) IBOutlet UILabel *mvpCount;


@property (weak, nonatomic) IBOutlet UILabel *kda;
@property (weak, nonatomic) IBOutlet UILabel *kda_2;
@property (weak, nonatomic) IBOutlet UIView *progresView;

@end

@implementation LLT_PlayerHeroViewCell_LXM

-(void)setHeroRecord:(LLT_PlayerHeroRecordModel *)heroRecord{
    if (_heroRecord != heroRecord) {
        _heroRecord = nil;
        _heroRecord = heroRecord;
    }
    self.per.text = [_heroRecord.winRate stringValue];
    self.useCount.text = [_heroRecord.matchStat stringValue];
    self.mvpCount.text = [_heroRecord.totalMVP stringValue];
    ProgressBarView *pbv = [ProgressBarView progressBarViewInstanceByFrame:self.progresView.bounds andProgressNum:[_heroRecord.winRate floatValue]];
    [self.progresView addSubview:pbv];
    [self bringSubviewToFront:self.progresView];
    self.kda.text = _heroRecord.averageKDARating;
    self.kda_2.text = _heroRecord.averageKDA;
    [self.heroImage sd_setImageWithURL:[NSURL URLWithString:HeroPic(_heroRecord.championName)]];
    self.heroImage.layer.masksToBounds = YES;
    self.heroImage.layer.cornerRadius = self.heroImage.frame.size.width/2;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
